package com.yulongtian.weekCompetition.month202301.week03;

/**
 * 第 328 场周赛
 * 可
 *
 * @author yulongTian
 * @create 2023-01-15 10:36
 */
public class Test01 {
    public static void main(String[] args) {

    }

    public static int differenceOfSum(int[] nums) {
        int allSum = 0;
        int addressSum = 0;
        for (int num : nums) {
            allSum += num;
            while (num > 0) {
                addressSum += num % 10;
                num /= 10;
            }
        }
        return Math.abs(allSum - addressSum);
    }
}
